﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Data.Linq.Mapping;
using System.Linq;
using System.Text;
using Chowpoo.Sql;

namespace CourseSystem.Core.Entities
{
    [Table(Name = "Teacher")]
    public class TeacherInfo : IDetach
    {
        public TeacherInfo()
        {
            Detach();
        }
        #region Model
        private int _id;
        private string _account = "";
        private string _name = "";
        private string _pass = "";
        private int _onlineTime = 0;
        private int _type = 0;
        private string _introduction = "";
        private string _img = "";
        private string _titles = "";

        /// <summary>
        /// 
        /// </summary>
        [Column(IsDbGenerated = true, IsPrimaryKey = true, IsVersion = true)]
        public int Id
        {
            set { _id = value; }
            get { return _id; }
        }
        /// <summary>
        /// 
        /// </summary>
        [Column]
        [DisplayName("用户名")]
        [Required(ErrorMessage = "必须填写")]
        public string Account
        {
            set { _account = value; }
            get { return _account; }
        }
        /// <summary>
        /// 
        /// </summary>
        [Column]
        [DisplayName("姓名")]
        [Required(ErrorMessage = "必须填写")]
        public string Name
        {
            set { _name = value; }
            get { return _name; }
        }
        /// <summary>
        /// 
        /// </summary>
        [Column]
        [DisplayName("密码")]
        public string Pass
        {
            set { _pass = value; }
            get { return _pass; }
        }

        /// <summary>
        /// 0管理员1负责老师2主讲老师3助教4专家
        /// </summary>
        [Column]
        [DisplayName("类型")]
        public int Type
        {
            set { _type = value; }
            get { return _type; }
        }
        /// <summary>
        /// 
        /// </summary>
        [Column]
        [DisplayName("简介")]
        public string Introduction
        {
            set { _introduction = value; }
            get { return _introduction; }
        }
        /// <summary>
        /// 
        /// </summary>
        [Column]
        [DisplayName("相片:150px*150px")]
        public string Img
        {
            set { _img = value; }
            get { return _img; }
        }

        [Column]
        public int OnlineTime
        {
            set { _onlineTime = value; }
            get { return _onlineTime; }
        }

        [DisplayName("教师职称")]
        [Column]
        public string Titles
        {
            set { _titles = value; }
            get { return _titles; }
        }
        #endregion Model

        public void Detach()
        {

        }
    }
}
